package homework4;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class Student {
	public static void main(String[] args) {
		ArrayList<String> names1 = new ArrayList<String>();
		ArrayList<String> names2 = new ArrayList<String>();
		ArrayList<String> names3 = new ArrayList<String>();
		names1.add("张三丰");
		names1.add("杨过");
		names1.add("郭靖");
		names2.add("乔峰");
		names2.add("黄蓉");
		names3.add("小龙女");
		names3.add("段玉");
		names3.add("阿朱");
		
		HashMap<String, ArrayList<String>> grades = new HashMap<String, ArrayList<String>>();
		grades.put("三年级一班", names1);
		grades.put("三年级二班", names2);
		grades.put("三年级三班", names3);
		
		Scanner input = new Scanner(System.in);
		System.out.println("输入班级名称：");
		String key = input.next();
		System.out.println("三年级一班的学生列表：");
		ArrayList<String> values = grades.get(key);
		for(String name : values){
			System.out.println(name);
		}
		
	}
}
